package com.sky.mapper.user;

import com.sky.pojo.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Description ShoppingCartMapper
 * @Author lijingtong
 * @Date 2024-10-13
 */
@Mapper
public interface ShoppingCartMapper {


    /**
     * 判断是否在购物车中
     * @param shoppingCart
     * @return
     */
    List<ShoppingCart> list(ShoppingCart shoppingCart);

    /**
     * 更新购物车相同菜品的数量
     * @param shoppingCart
     */
    void updateNumberById(ShoppingCart shoppingCart);

    /**
     * 添加到购物车
     * @param shoppingCart
     */
    void insert(ShoppingCart shoppingCart);

    /**
     * 查看购物车
     * @param currentId
     * @return
     */
    List<ShoppingCart> showShoppingCart(Long currentId);

    /**
     * 清空购物车
     */
    void cleanShoppingCart(Long userId);

    /**
     * 出餐时间
     * @param currentId
     * @return
     */
    Integer getMakeTimeByUserId(Long currentId);


}
